home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / ubiquity / tzsetup < prev    next >
Text File  |  2009-09-27  |  1KB  |  48 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. . /usr/share/debconf/confmodule
  5. db_capb backup
  6.  
  7. /usr/lib/ubiquity/tzsetup/tzsetup
  8.  
  9. if [ -z "$UBIQUITY_OEM_USER_CONFIG" ]; then
  10.     # Set the timezone in the live system. (Cloned-and-hacked from
  11.     # tzsetup/post-base-installer.d/05tzsetup.)
  12.     db_get time/zone
  13.     zone="$RET"
  14.  
  15.     if [ ! -e /usr/share/zoneinfo/$zone ]; then
  16.         logger -t tzsetup "Warning: ignoring invalid time zone '$zone'"
  17.         exit 0
  18.     fi
  19.  
  20.     echo "$zone" > /etc/timezone
  21.     rm -f /etc/localtime
  22.     cp -f /usr/share/zoneinfo/$zone /etc/localtime
  23. fi
  24.  
  25. if [ "$TZSETUP_NO_LOCALECHOOSER" ]; then
  26.     exit 0
  27. fi
  28.  
  29. # Reconfigure locale according to the selected country. We rely on
  30. # ubiquity/components/timezone.py having set debian-installer/country for
  31. # us.
  32. db_get debian-installer/country
  33. country="$RET"
  34. db_set mirror/country "$country" || true
  35. db_get debian-installer/locale
  36. newlocale="$(echo "$RET" | sed "s/_[A-Z][A-Z]*/_$country/")"
  37. if grep -q "^${newlocale%%[.@]*}[.@ ]" /usr/share/i18n/SUPPORTED; then
  38.     db_set debian-installer/locale "$newlocale"
  39.     db_fset debian-installer/locale seen true
  40.     # Let localechooser know that we're using the same language as
  41.     # before, so that it doesn't set a default country again.
  42.     db_fset localechooser/languagelist seen false
  43.     rm -f /var/lib/localechooser/preseeded
  44.     PATH="/usr/lib/ubiquity/localechooser:$PATH" \
  45.         OVERRIDE_SHOW_ALL_LANGUAGES=1 \
  46.         /usr/lib/ubiquity/localechooser/localechooser
  47. fi
  48.